package com.ktwlrj.securitycenter.controller.args;

import com.ktwlrj.core.validation.group.Update;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.util.List;

/**
 * 预警拦截添加入参
 *
 * @author makejava
 * @since 2020-02-24 18:08:13
 */
@Getter
@Setter
@ToString
@EqualsAndHashCode
@ApiModel(value = "预警拦截添加入参", description = "预警拦截添加入参")
public class SafeInterceptArgs implements Serializable {
    private static final long serialVersionUID = -51979635059367420L;

    @ApiModelProperty(name = "interceptId", value = "主键id")
    @NotBlank(message = "主键id不能为空", groups = Update.class)
    private String interceptId;

    @ApiModelProperty(name = "interceptCode", value = "拦截编号")
    @NotBlank(message = "拦截编号不能为空")
    private String interceptCode;

    @ApiModelProperty(name = "ruleName", value = "规则名称")
    @NotBlank(message = "规则名称不能为空")
    private String ruleName;

    @ApiModelProperty(name = "target", value = "对象(1.人员，2.房屋,3.交易)")
    @NotNull(message = "对象不能为空")
    private Integer target;

    @ApiModelProperty(name = "targetCount", value = "限制对象数")
    private Integer targetCount;

    @ApiModelProperty(name = "ruleCount", value = "限制业务数")
    private Integer ruleCount;

    @ApiModelProperty(name = "regionCode", value = "区域编号")
    @NotBlank(message = "区域编号不能为空")
    private String regionCode;

    @ApiModelProperty(name = "regionName", value = "区域名称")
    @NotBlank(message = "区域名称不能为空")
    private String regionName;

    @ApiModelProperty(value = "预警拦截类型（1=新建,2=变更）", hidden = true)
    private Integer interceptType;

    @ApiModelProperty(name = "remark", value = "备注")
    private String remark;

    @ApiModelProperty(name = "interceptRuleList", value = "预警拦截规则列表")
    @NotEmpty(message = "预警拦截规则列表不能为空")
    @Size(min = 1, message = "预警拦截规则列表不能为空")
    @Valid
    private List<SafeInterceptRuleArgs> interceptRuleList;

    @ApiModelProperty(name = "interceptTargetList", value = "预警拦截对象列表")
    private List<SafeInterceptTargetArgs> interceptTargetList;

    @ApiModelProperty(name = "interceptTargetList", value = "凭证信息列表")
    private List<SafeCredentialArgs> credentialList;
}